﻿<UserControl x:Class="VisualWip.SizeAndPositionAdornerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:vm="clr-namespace:VisualWip.PresentationModel;assembly=PresentationModel" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Visibility="{Binding SizeAndPositionAdornerVisibility}" Width="{Binding ActualWidth}" Height="{Binding ActualHeight}">
    <Grid Opacity="10" >
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Thumb Grid.Row="0" Grid.Column="0"  Name="nwThumb" HorizontalAlignment="Left" VerticalAlignment="Top" PreviewMouseLeftButtonUp="NwThumb_OnPreviewMouseLeftButtonUp" DragDelta="nwThumb_DragDelta" Width="15" Height="15" Panel.ZIndex="1" />
        <Thumb Grid.Row="4" Grid.Column="0"  Name="swThumb" HorizontalAlignment="Left" VerticalAlignment="Bottom" PreviewMouseLeftButtonUp="SwThumb_OnPreviewMouseLeftButtonUp" DragDelta="swThumb_DragDelta"  Width="15" Height="15" />
        <Thumb Grid.Row="0" Grid.Column="4"  Name="neThumb" HorizontalAlignment="Right" VerticalAlignment="Top" PreviewMouseLeftButtonUp="NeThumb_OnPreviewMouseLeftButtonUp"  DragDelta="neThumb_DragDelta" Width="15" Height="15" Panel.ZIndex="1" />
        <Thumb Grid.Row="4" Grid.Column="4"  Name="seThumb" HorizontalAlignment="Right" VerticalAlignment="Bottom" PreviewMouseLeftButtonUp="SeThumb_OnPreviewMouseLeftButtonUp"  DragDelta="seThumb_DragDelta" Width="15" Height="15"/>
        <Thumb Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5"  Name="moveThumb" HorizontalAlignment="Stretch" VerticalAlignment="Top" PreviewMouseLeftButtonUp="MoveThumb_OnPreviewMouseLeftButtonUp"  DragDelta="moveThumb_DragDelta">
            <Thumb.Template>
                <ControlTemplate>
                    <Border BorderThickness="2">
                        <Grid>
                            <Rectangle Height="Auto" HorizontalAlignment="Stretch" x:Name="rectangle1" Stroke="DarkGray" VerticalAlignment="Stretch" Width="Auto" StrokeThickness="1" RadiusX="2" RadiusY="2" />
                            <Grid Background="LightGreen" Opacity="0.7">
                                <Grid.RowDefinitions>
                                    <RowDefinition MinHeight="40" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Button Grid.Column="1" Content="Settings" Name="settingsButton" Margin="3"  Command="{Binding SettingsCommand}" HorizontalAlignment="Left" VerticalAlignment="Bottom">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Source="/VisualWip;component/Images/OptionsHS.png" Width="16" Height="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                                    <Button Content="+" Command="{Binding ForwardCommand}"  Name="forwardButton">
                                        <Button.Template>
                                            <ControlTemplate>
                                                <Image Source="/VisualWip;component/Images/BringForwardHS.png" Width="16" Height="16" Margin="3" />
                                            </ControlTemplate>
                                        </Button.Template>
                                    </Button>
                                    <Button Content="-" Command="{Binding BackwardCommand}"  Name="backwardButton">
                                        <Button.Template>
                                            <ControlTemplate>
                                                <Image Source="/VisualWip;component/Images/SendBackwardHS.png" Width="16" Height="16" Margin="3" />
                                            </ControlTemplate>
                                        </Button.Template>
                                    </Button>
                                </StackPanel>
                                <Button Grid.Column="3" Content="Close" Name="closeButton" Margin="3"  Command="{Binding CloseCommand}" HorizontalAlignment="Right" VerticalAlignment="Bottom">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Width="16" Height="16" Source="/VisualWip;component/Images/DeleteHS.png" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Thumb.Template>
        </Thumb>
    </Grid>
</UserControl>
